package com.mashibing.strategy.mq;

import com.mashibing.common.constant.RabbitMQConstants;
import com.mashibing.common.model.StandardSubmit;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * @ClassName:PreSebdListener
 * @author:[开发者名称]
 * @Description:[监听接口模块推送过来的消息]
 * @Date:2025/9/18/17:43
 * @Version:1.0
 */
@Slf4j
@Component
public class PreSebdListener {
    @RabbitListener(queues = RabbitMQConstants.SMS_PRE_SEND)
    public void listen(StandardSubmit submit, Message message, Channel channel) throws IOException {
        log.info("【策略模块-接收消息】 接收到接口模块发送的消息 submit = {}",submit);
        // 处理业务…………



        log.info("【策略模块-消费完毕】手动ack");
        channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
    }
}

